#!/usr/bin/env python
# -*- coding: utf-8 -*-

from tools.request_control import RequestControl
from config.settings import ConfigHandler
from tools.yaml_data_analysis import CaseData
from tools.regular_control import regular
import os
from tools.teardown_control import TearDownHandler

class ApiCreateTask(object):
    @staticmethod
    def api_create_task(inData):
        """
        :param inData:
        :return:
        """
        res = RequestControl().http_request(eval(inData))
        TearDownHandler().teardown_handle(res)
        return res


if __name__ == '__main__':
    
    TestData = CaseData(os.path.join(ConfigHandler.data_path,'dm/fota/api_create_task.yaml')).case_process()[0]
    re_data = regular(str(TestData))
    data = ApiCreateTask().api_create_task(re_data)
    print(data)
        